package com.yuwj.chinaa.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.yuwj.chinaa.R;
import com.yuwj.chinaa.base.BaseActivity;
import com.yuwj.chinaa.entity.EntityNotice;
import com.yuwj.chinaa.presenter.IPresenter;
import com.yuwj.chinaa.presenter.presenterImpl.PresenterImpl;

import java.util.Calendar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class NoticeDetailActivity extends BaseActivity {


    IPresenter presenter;
    EntityNotice entityNotice;
    @BindView(R.id.iv_back)
    ImageButton ivBack;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_content)
    TextView tvContent;

    public static Intent createIntent(Context context, EntityNotice entityNotice) {
        Intent intent = new Intent(context, NoticeDetailActivity.class);
        intent.putExtra("entityNotice", entityNotice);
        return intent;
    }

    @Override
    public int setCustomContentViewResourceId() {
        return R.layout.activity_notice_detail;
    }

    @Override
    public void initParam() {
        Intent intent = getIntent();
        entityNotice = (EntityNotice) intent.getSerializableExtra("entityNotice");
        presenter = new PresenterImpl(this);
    }

    @Override
    public void initView() {
        tvTitle.setText(entityNotice.getMsgTitle());
        tvTime.setText(entityNotice.getCreateTime());
        tvContent.setText(entityNotice.getMsgDes());
    }

    @Override
    public void initOperator() {
    }


    @OnClick({R.id.iv_back, R.id.tv_title})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                onBackPressed();
                break;
            case R.id.tv_title:
                break;
        }
    }
}
